|
RAIS
3.2
|
00001 00028 using System; 00029 using System.Collections.Generic; 00030 using System.Text; 00031 using System.Data; 00032 00033 namespace RAIS.Common.UserManagement 00034 { 00038 public class Mask : DBObject 00039 { 00040 #region fields 00041 FunctionRole.Subcategory parent; 00042 string reference; 00043 int dynamicMaskID; 00044 #endregion 00045 #region Properties 00046 00049 public FunctionRole.Subcategory Parent 00050 { 00051 get { return this.parent; } 00052 set { this.parent = value; } 00053 } 00057 public string FullName 00058 { 00059 get 00060 { 00061 if (this.Parent != null) 00062 return this.Parent.FullName + Constants.SEPARATOR + this.Name; 00063 else 00064 return this.Name; 00065 } 00066 } 00070 public string Reference 00071 { 00072 get { return this.reference; } 00073 set { this.reference = value; } 00074 } 00078 public int DynamicMaskID 00079 { 00080 get { return this.dynamicMaskID; } 00081 set { this.dynamicMaskID = value; } 00082 } 00083 #endregion 00084 #region Constructors 00085 public Mask() 00086 {} 00087 public Mask(IDataRecord record) 00088 { 00089 this.ID = (int)record["PK Mask ID"]; 00090 this.Name = record["Mask Name"].ToString(); 00091 this.reference = record["Reference"].ToString(); 00092 if (record["PK Dynamic Mask ID"].ToString() != "") 00093 this.dynamicMaskID = (int)record["PK Dynamic Mask ID"]; 00094 this.parent = new FunctionRole.Subcategory(record); 00095 } 00096 #endregion 00097 #region Public methods 00098 public bool RestricitonsConflict(Mask mask) 00099 { 00100 if (mask.Name == RAIS.Common.Constants.ALL_MASKS && 00101 this.Name != RAIS.Common.Constants.ALL_MASKS) 00102 return true; 00103 else 00104 if (mask.Name != RAIS.Common.Constants.ALL_MASKS && 00105 this.Name == RAIS.Common.Constants.ALL_MASKS) 00106 return true; 00107 else 00108 return false; 00109 } 00110 #endregion 00111 } 00112 }